package com.sdb.patientuser.service.impl;

import com.sdb.common.utils.SecurityUtils;
import com.sdb.patientuser.domain.Patientuser;
import com.sdb.patientuser.mapper.PatientuserMapper;
import com.sdb.patientuser.service.PatientuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PatientuserServiceImpl implements PatientuserService {


    @Autowired
    private PatientuserMapper patientuserMapper;

    @Override
    public int bang(Patientuser patientuser) {
        Long userid = SecurityUtils.getUserId();
        patientuser.setUserId(userid);
        return patientuserMapper.bang(patientuser);
    }

    @Override
    public Patientuser getbyuserid() {
        Long userid = SecurityUtils.getUserId();
        return patientuserMapper.getbyuserid(userid);
    }

    @Override
    public int updatepatient(Patientuser patientuser) {
        return patientuserMapper.updatepatient(patientuser);
    }
}
